<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>结构伪类</title>
    <style>
      article article:nth-child(3) {
        color: red;
      }
      main table tr > td:nth-last-child(-n + 2) {
        background: green;
        color: white;
      }
      ul li:nth-child(-n+3):not(:nth-child(2)):not(:nth-child(3)){
        background:red;
      }
    </style>
  </head>
  <body>
    <main>
      <ul>
        <li>houdunren.com</li>
        <li>hdcms.com</li>
        <li>后盾人</li>
        <li>hdcms.com</li>
        <li>后盾人</li>
        <li>hdcms.com</li>
        <li>后盾人</li>
      </ul>
      <table border="1">
        <tr>
          <td>houdunren.com</td>
          <td>hdcms.com</td>
          <td>后盾人</td>
          <td>houdunwang.com</td>
          <td>hdcms</td>
        </tr>
      </table>
      <article>
        <span>houdunren.com</span>
        <aside>
          <span>houdunwang.com</span>
          <span>hdcms.com</span>
        </aside>
        <span>hdphp.com</span>
      </article>
    </main>
  </body>
</html>
